/*
 * Copyright (c) 2007 jNetX.
 * http://www.jnetx.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * jNetX. You shall not disclose such Confidential Information and
 * shall use it only in accordance with the terms of the license
 * agreement you entered into with jNetX.
 *
 * $Id$
 */
package com.jnetx.javax.sip.header;

import junit.framework.TestCase;

import java.text.ParseException;

/**
 * @author <a href="mailto:dparhonin@jnetx.ru">Dmitry Parhonin</a>
 * @version $Revision$
 */
public class PriorityHeaderParserTest extends TestCase {
    public PriorityHeaderParserTest(String name) {
        super(name);
    }

    public void test() {
        final byte[] data = "Priority: non-urgent".getBytes();
        final PriorityHeaderParser parser = new PriorityHeaderParser();
        PriorityHeaderImpl[] headers;
        try {
            headers = parser.parse(data, 9, data.length);
        } catch (ParseException e) {
            fail(e.getMessage());
            return;
        }
        assertNotNull("The result is null!", headers);
        assertEquals("The length of the result is wrong!", 1, headers.length);
        assertEquals("The priority is wrong!", "non-urgent", headers[0].getPriority());
        assertEquals("The string representation is wrong!", "Priority: non-urgent", headers[0].toString());
    }
}
/*
 * $Log$
 */